<div class="col-sm-12 mt20">
	<div class="panel">
		<div class="panel-body">
			<div class="col-sm-12">
				<div class="row">
					<div class="col-sm-2">
						<input type="text" class="form-control" ng-model="searchform.company_code" placeholder="分销商编号">
					</div>
					<div class="col-sm-2">
						<input type="text" class="form-control" ng-model="searchform.login_name" placeholder="销售账户">
					</div>
					<div class="col-sm-2">
						<input type="text" class="form-control" ng-model="searchform.view" placeholder="景区编号">
					</div>
					<div class="col-sm-2">
						<input type="text" class="form-control" ng-model="searchform.sale_name" placeholder="销售品名称">
					</div>
					<div class="col-sm-2">
						<ui-select ng-model="searchform.seltype" ng-change="changetype()" theme="bootstrap" ng-keyup="myKeyup($event)">
							<ui-select-match placeholder="使用时间">
								{{$select.selected.label}}
							</ui-select-match>
							<ui-select-choices repeat="item.value as item in  chaxunarr | filter: $select.search">
								<span ng-bind-html="item.label | highlight: $select.search"></span>
							</ui-select-choices>
						</ui-select>
					</div>
					<div class="col-sm-2" ng-show="showtype == '0'">
						<input type="button " class="btn btn-info search form-control" ng-click="load()" value="立即搜索">
					</div>
					<div class="col-sm-2" ng-show="showtype == '1'">
					</div>
				</div>
				<div class="row mt10" ng-show="showtype == '1'">
					<div class="col-sm-2">
						<input type="text" class="form-control" datepicker-popup="yyyy-MM-dd" ng-model="date.lable" is-open="date.opened" ng-click="dateOpen($event, date)"
							placeholder="开始时间" ng-required="true" close-text="关闭" current-text="今天" clear-text="清除" readonly/>
					</div>
					<div class="col-sm-2">
						<input type="text" class="form-control" datepicker-popup="yyyy-MM-dd" ng-model="date1.lable" is-open="date1.opened" ng-click="dateOpen1($event, date1)"
						placeholder="结束时间" ng-required="true" close-text="关闭" current-text="今天" clear-text="清除" readonly/>
					</div>
					<div class="col-sm-2">
					</div>
					<div class="col-sm-2">
					</div>
					<div class="col-sm-2">
					</div>
					<div class="col-sm-2">
						<input type="button " class="btn btn-info search form-control" ng-click="load()" value="立即搜索">
					</div>
				</div>
			</div>
		</div>
	</div>



	<!--<div class="row mt15"  style="margin-top:15px">
              <label>使用时间</label>&nbsp;&nbsp;
              <select class="form-control" ng-model="searchform.seltype" ng-change="changetype()">
              	<option value="0">实时查询</option>
              	<option value="1">历史查询</option>
        	  </select>&nbsp;&nbsp;
        	  <div ng-show="showtype == '1'" style="margin-top:15px">
                  <div class="input-group">
	              <input type="text" class="form-control" datepicker-popup="yyyy-MM-dd" ng-model="date.lable" is-open="date.opened" 
                    readonly close-text="关闭" current-text="今天" clear-text="清除" />
                    <span class="input-group-btn">
                        <button type="button" class="btn btn-default"
                                ng-click="dateOpen($event, date)">
                            <i class="glyphicon glyphicon-calendar"></i>
                        </button>
                    </span>
                  </div>
                        &nbsp;&nbsp;到&nbsp;&nbsp;            
                  <div class="input-group">

                      <input type="text" class="form-control" datepicker-popup="yyyy-MM-dd" ng-model="date1.lable" is-open="date1.opened" 
                    readonly close-text="关闭" current-text="今天" clear-text="清除" />
                    <span class="input-group-btn">
                        <button type="button" class="btn btn-default"
                                ng-click="dateOpen1($event, date1)">
                            <i class="glyphicon glyphicon-calendar"></i>
                        </button>
                    </span>
                  </div>
	              &nbsp;&nbsp;
              </div>

              <button type="button" class="btn btn-default search pull-right" ng-click="load(searchform.sale_name)">立即搜索</button>

              </div>
              
            </div>
        </div>
    </div>-->
	<!-- searchArea -->
	<div class="panel panel-default">

		<table class="table table-hover table-bordered">
			<thead>
				<tr>
					<th class="col-md-1 text-center">时间</th>
					<th class="col-md-3 text-center">销售品名称</th>
					<th class="col-md-1 text-center">分销商</th>
					<th class="col-md-1 text-center">销售账户</th>
					<th class="col-md-1 text-center">购买数量</th>
					<th class="col-md-1 text-center">使用数量</th>
					<th class="col-md-1 text-center">退票数量</th>
					<th class="col-md-1 text-center">单价</th>
					<th class="col-md-1 text-center">总计</th>
					<th class="col-md-1 text-center">详情</th>
				</tr>
			</thead>
			<tbody>
				<tr ng-repeat="obj in objs">
					<td class="text-center">{{obj.date}}</td>
					<td class="">{{obj.name}}
						<br>{{obj.sale_code}}</td>
					<td class="text-center">{{obj.company_name}}
						<br>{{obj.company_code}}</td>
					<td class="text-center">{{obj.operation_login_name}}</td>
					<td class="text-center">{{obj.buy}}</td>
					<td class="text-center">{{obj.used}}</td>
					<td class="text-center">{{obj.back}}</td>
					<td class="text-center">{{obj.unit_price}}</td>
					<td class="text-center">{{(obj.total_buy - obj.total_back) * 0.01 | currency : '￥'}}</td>
					<td class="text-center">
						<a ng-click="detail(obj)" ng-hide="obj.used == 0" class="btn btn-success btn-sm">使用详情</a>
					</td>
				</tr>
				<tr>
					<td class="text-center">总计</td>
					<td class=""></td>
					<td class="text-center"></td>
					<td class="text-center"></td>
					<td class="text-center">{{total.buy}}</td>
					<td class="text-center">{{total.used}}</td>
					<td class="text-center">{{total.back}}</td>
					<td class="text-center"></td>
					<td class="text-center">{{total.total * 0.01 | currency : '￥'}}</td>
					<td class="text-center"></td>
				</tr>

			</tbody>
		</table>


	</div>
</div>